﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.Goods;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Goods
{
    public class GoodsSetCommandHandler : IRequestHandler<GoodsSetCommand, GoodsInfo>
    {
        protected readonly IGoodService goodService;

        public GoodsSetCommandHandler(IGoodService goodService)
        {
            this.goodService = goodService;
        }

        public async Task<GoodsInfo> Handle(GoodsSetCommand request, CancellationToken cancellationToken)
        {
            return await goodService.SetGoods(request.id);
        }
    }
}
